<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0-2-1" />
<title>借阅管理</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中 -->
<script>
	$(document).ready(function() {
		 //綁定日期控件
		 $("#lendDate").addClass("Wate").bind("click", function(){
   	     WdatePicker({skin:'whyGreen',minDate:'1990-01-01',maxDate:'#F{$dp.$D(\'preparationAlsoDate\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd'});
		 });
		 
		 $("#preparationAlsoDate").addClass("Wate").bind("click", function(){
	   	     WdatePicker({skin:'whyGreen',minDate:'#F{$dp.$D(\'lendDate\')}',dateFmt:'yyyy-MM-dd'});
	   	     });
		//獲得焦點到第一個文本框
		 $("#bookName").focus();
		//選擇圖書信息			
		 $("#chooseBook").click(function (){
					var url = "${ctx}/asset/book/bksn!list.action"
				    mm = showDialogWindow(url);
					if (mm != null) {
						$("#bookId").val(mm.bookId);
						$("#bookNames").val(mm.bookNames);
					}
				});
		//驗證選擇圖書
		$("#checkBookNum").mouseover(function(){
			var bookIds = $("#bookId").val();
			if(bookIds==""||bookIds==null){
				alert("请选择要借出的图书!");	
				return false;
			}
			return true;
			});
		});
	</script>
</head>
<body>
<form action="${ctx }/asset/book/lend!save.action" method="post" id="inputForm"
	class='yform'>
<div id="caption" ><h6>${bookName}添加借阅记录</h6></div>
<table class="noborder">
	<tr class="type-title">
	</tr>
	<tr class="type-text">
		<td>借阅人</td>
		<td><input type="text" name="lendPerson" value="${lendPerson}" />
		<input type="hidden" name="id" value="${id}" /></td>
		<td>借阅时间</td>
		<td><input id="lendDate" type="text" name="lendDate"
			value="${lendDate}" readonly="readonly" /></td>
	</tr>
	<tr class="type-select">
		<td>预归还时间</td>
		<td class="type-text"><input id="preparationAlsoDate" type="text"
			name="preparationAlsoDate" value="${preparationAlsoDate}" /></td>
		<td>图书选择</td>
		<td class="type-text"><input type="hidden" " id="bookId"
			name="BOOKID" /><input type="text" id="bookNames" readonly="readonly"/> <input id="chooseBook" type="button" value="选择" />
		</td>

	</tr>
	<tr class="type-text">
		<td>备注</td>
		<td colspan="3"><textarea rows="5" name="remark" cols="30">${remark}</textarea>
		</td>
	</tr>
</table>
<div class="type-button"><input id="checkBookNum"  
	type="submit" class="submit" value="提交" />&nbsp; <input  
	type="button" value="返回" class="reset" onclick="history.back()" /></div>
</form>
</body>
</html>
